Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create 'brot' command-line compression program #163

Closed
wants to merge 1 commit into from

Conversation

agordon
Copy link

@agordon agordon commented Sep 23, 2015

'brot' supports the same common usage as gzip/bzip2/xz .

add two test scripts:

  • brot-test.sh compares behaviour with gzip/bzip2/xz
  • brot-size-test.sh compares compression sizes with gzip/bzip2/xz

(could be renamed to 'bro', but I didn't want to override the current 'bro' program).

'brot' supports the same common usage as gzip/bzip2/xz .

add two test scripts:
* brot-test.sh compares behaviour with gzip/bzip2/xz
* brot-size-test.sh compares compression sizes with gzip/bzip2/xz
@CoolOppo
Copy link

I feel like there's a better name that could be used. I do like bro, but if that's already in use, that isn't really an option.

@khaledhosny
Copy link
Contributor

I think the existing pro tool can be replaced by this one, behaving like existing tools is a big plus.

@CoolOppo
Copy link

@khaledhosny I think you mean bro, and if so, I completely agree. The current command-line bro tool is extremely annoying to use. Both gzip and xz work excellently as command-line tools, and there's really no good reason to differ from those.

@szabadka
Copy link
Collaborator

szabadka commented Oct 2, 2015

We decided to change the interface of the bro tool to match gzip.

Would you be willing to change bro.cc with these changes to the command line parsing? For easier review, it could be broken up into multiple pull requests, e.g. as a first step factor out the function that processes one file from main().

As for function naming and other style conventions, please see https://google-styleguide.googlecode.com/svn/trunk/cppguide.html

And in order to accept your contributions, you have to sign a CLA (see https://github.com/google/brotli/blob/master/CONTRIBUTING)

@Arkanosis
Copy link

That would be great!

BTW shouldn't --best be an alias for -11 instead of -9? That will probably be a bit more complex to handle since -11 is not a short option anymore, though.

kevinoid added a commit to kevinoid/kevinlocke.name that referenced this pull request Jan 19, 2016
If the brotli command line program is available (as used in the
pre-release Debian package[1]), use it to precompress text files and
serve these files with the br encoding (as accepted by Firefox 44 and
later).  Use the .bro extension, as used in the current pull request for
a proper command-line program.[2]

1.  https://anonscm.debian.org/cgit/collab-maint/brotli.git/
2.  google/brotli#163

Signed-off-by: Kevin Locke <[email protected]>
#define BUGREPORT "[email protected]"

/* File extensions for brotli files */
#define EXTENSION ".bro"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was changed to .br.

break;

case 'd':
opmode = DECOMPRESS;
Copy link

@gvaish gvaish Jan 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be allow only one of c or d. Exit with an error when both are provided.

Let the default value of opmode be UNKNOWN with:

typedef struct _opmode {
   BROT_MODE_UNKNOWN,
   BROT_MODE_COMPRESS,
   BROT_MODE_DECOMPRESS
} opmode;
case 'c': {
  if (opmode != BROT_MODE_UNKNOWN) {
    exit_with_error(some-code);
  }
  proceed-with-compression
}

@thedrow
Copy link

thedrow commented Mar 26, 2017

Any chance to get this merged?

@zmichael
Copy link

Please Please Please merge it

@agordon
Copy link
Author

agordon commented May 22, 2017

To anyone following this topic (the 'brot' stand-alone compression) program:
I've long ago signed google's CLA (in fact, on Oct 02, 2015 11:23 PDT).

I haven't been keeping track of brotli since I wrote this - but if anyone is interested in picking it up and making it work - they have my full support. If there are minor changes that I can help with - let me know.

@eustas
Copy link
Collaborator

eustas commented May 23, 2017

Soon I will be landing next brotli update. Among other things it contains new CLI...

@eustas eustas closed this May 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants